<template>
  <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
    <el-tab-pane label="指定对象" name="first">
      <el-input v-model="packageIds" type="textarea" :rows="10" placeholder="请输入应用/游戏appId，多个参数用英文逗号隔开(,)，最多输入1000条" @input="handleInput" />
    </el-tab-pane>
    <el-tab-pane label="文件上传" name="second">
      <TxtFileUpload :data="data" prop="targetApps" />
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import { TxtFileUpload } from 'modules/component/upload'
export default {
  components: { TxtFileUpload },
  props: {
    data: {
      type: Object,
      default: () => {}
    },
    props: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      activeName: 'first',
      packageIds: ''
    }
  },
  computed: {
    'data.targetApps': {
      get(val) {
        return val
      },
      set(val) {
        console.log(val)
      }
    }
  },
  watch: {
    value: {
      handler: function(val) {
        this.packageIds = val
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    handleClick() {},
    handleInput(val) {
      this.$emit('input', val)
    }
  }
}

</script>
